package main

import "fmt"
import "project01/com/oop/encapsulation/model1"

/**
 * @author: guangcheng
 * @date:   2020/11/22 15:04
 * @version  V1.0
 * @description:
 *
 */
func main() {
	p := model1.NewPerson("smith")
	p.SetAge(18)
	p.SetSal(5000)
	fmt.Println(*p)
	fmt.Println(p.Name, " age =", p.GetAge(), " sal = ", p.GetSal())

	//练习题
	//创建一个account变量
	account := model1.NewAccount("jzh11111", "123456", 10000)
	if account != nil {
		fmt.Println("创建成功=", *account)
	} else {
		fmt.Println("创建失败")
	}

	fmt.Println(account.GetAccountNo(), account.GetBalance(), account.GetPwd())
	account.SetAccountNo("abc999999")
	fmt.Println(*account)

}
